package cn.com.lms.business.exam.persistence.repository;

import cn.com.lms.business.exam.persistence.entity.ExerciseDepartJobInfo;

import com.bnzj.core.persistence.repository.BaseRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Map;

@Repository
public interface ExerciseDepartJobInfoRepository extends BaseRepository<ExerciseDepartJobInfo,Long> {

    @Transactional
    @Modifying
    @Query(value = "delete from bnz_exam_exercise_depart_job_info where exercise_id=?1", nativeQuery = true)
    public int deleteByExerciseId(Long exerciseId);

    @Query(value = "select obj_id as id, full_name as fullName,type from bnz_exam_exercise_depart_job_info where exercise_id=?1", nativeQuery = true)
    public List<Map> findByExerciseId(Long exerciseId);
}
